import { baseRequest } from '@/utils/request'

const request = (url, ...arg) => baseRequest(`/biz/cabinetpermission/` + url, ...arg)

/**
 * 柜门权限Api接口管理器
 *
 * @author kongxm
 * @date  2022/11/20 17:04
 **/
export default {
	// 获取柜门权限分页
	bizCabinetPermissionPage(data) {
		return request('page', data, 'get')
	},
	// 获取柜门权限列表
	bizCabinetPermissionList(data) {
		return request('list', data, 'get')
	},
	// 提交柜门权限表单 edit为true时为编辑，默认为新增
	bizCabinetPermissionSubmitForm(data, edit = false) {
		return request(edit ? 'add' : 'edit', data)
	},
	// 删除柜门权限
	bizCabinetPermissionDelete(data) {
		return request('delete', data)
	},
	// 获取柜门权限详情
	bizCabinetPermissionDetail(data) {
		return request('detail', data, 'get')
	},
	// 授权
	bizCabinetPermissionAuthorize(data) {
		return request('authorize', data)
	},
	// 批量授权
	bizCabinetPermissionBatchAuthorize(data) {
		return request('authorize/batch', data)
	},
	// 批量选择用户授权
	bizCabinetPermissionBatchAuthorizeUsers(data) {
		return request('authorize/batch/users', data)
	},
	// 拒绝
	bizCabinetPermissionRefuse(data) {
		return request('refuse', data)
	},
	// 冻结
	bizCabinetPermissionFreeze(data) {
		return request('freeze', data)
	},
	// 批量冻结用户
	bizCabinetPermissionBatchFreezeUsers(data) {
		return request('freeze/batch/users', data)
	},
	// 解冻
	bizCabinetPermissionUnfreeze(data) {
		return request('unfreeze', data)
	},
	// 解冻
	bizCabinetPermissionBatchRefuse(data) {
		return request('refuse/batch', data)
	},
	// 获取柜门权限列表
	bizCabinetPermissionListForDoor(data) {
		return request('list_permission', data, 'get')
	},
	// 获取证书列表
	bizCabinetPermissionListCertification(data) {
		return request('certification', data, 'get')
	}
}
